home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-02 | 4.2 KB | 167 lines | [TEXT/KAHL] |
- /******************************************************************************
- CQTDoc.cp
-
- CQTDoc Document Class
-
- Copyright © 1995 Gregory Bonk, NewMedia Inc. All rights reserved.
-
- Generated by Visual Architect™ 5:28 PM Tue, Aug 1, 1995
-
- Portions Copyright © 1992 Joe Zobkiw. All rights reserved.
- Portions Copyright © 1995 Symantec Corporation. All rights reserved.
- ******************************************************************************/
-
- #include "CQTDoc.h"
- #include "AppCommands.h" // Remove comments if DoCommand overridden
-
- #include <CApplication.h>
- #include "Movies.h"
- #include "QuickTime Utilities.h"
- #include "CQTPane.h"
-
-
- extern CBartender *gBartender; /* The menu handling object */
-
- TCL_DEFINE_CLASS_M1(CQTDoc, x_CQTDoc);
-
- /**** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ****/
-
- CQTDoc::CQTDoc()
- {
- TCL_END_CONSTRUCTOR
- }
-
-
- CQTDoc::~CQTDoc()
- {
- TCL_START_DESTRUCTOR
- }
-
-
- /******************************************************************************
- ICQTDoc
-
- Initialize the document
-
- ******************************************************************************/
- void CQTDoc::ICQTDoc()
- {
- Ix_CQTDoc();
- }
-
- /******************************************************************************
- MakeNewWindow
-
- Create a new, empty window. Subclass may override to populate
- the new window.
- ******************************************************************************/
- void CQTDoc::MakeNewWindow(void)
- {
- CQTPane *theQOPane;
- CScrollPane *theScrollPane;
-
- inherited:: MakeNewWindow();
-
- theScrollPane = new CScrollPane(itsWindow, this, 10, 10, 0, 0,
- sizELASTIC, sizELASTIC, TRUE, TRUE, TRUE);
-
-
- theScrollPane->FitToEnclFrame(TRUE, TRUE);
-
- theQOPane = new CQTPane();
- theQOPane->IQTPane(theScrollPane, this, 0, 0, 0, 0, sizELASTIC, sizELASTIC, NULL);
- itsGopher = itsMainPane = theQOPane;
-
- itsMainPane->FitToEnclosure(TRUE, TRUE);
- theScrollPane->InstallPanorama(theQOPane);
- }
-
- /******************************************************************************
- MakeNewContents
-
- Create "blank" document contents. MakeNewContents is called
- after itsWindow is created and before it is first selected,
- whether or not the document uses a file.
- ******************************************************************************/
- void CQTDoc::MakeNewContents()
- {
- }
-
-
- /******************************************************************************
- ContentsToWindow
-
- Make window reflect document's contents. If the document does
- not use a file, this function is never called and may be deleted.
- ******************************************************************************/
- void CQTDoc::ContentsToWindow()
- {
- }
-
-
- /******************************************************************************
- WindowToContents
-
- Make document's contents reflect window's contents (if they
- don't already). If the document does not use a file, this
- function is never called and may be deleted.
- ******************************************************************************/
- void CQTDoc::WindowToContents()
- {
- }
-
-
- /******************************************************************************
- DoCommand
-
- ******************************************************************************/
- void CQTDoc::DoCommand(long theCommand)
- {
- FSSpec spec;
-
- switch (theCommand)
- {
- case cmdImportMovieItem:
- if (GetMovieFileFSSpec(&spec))
- {
- ((CQTPane*)itsMainPane)->ImportMovie(&spec);
- itsWindow->SetTitle(spec.name);
- }
- break;
- default:
- inherited::DoCommand(theCommand);
- break;
- }
- }
-
-
- /******************************************************************************
- UpdateMenus
-
- In this method you can enable menu commands that apply when
- your document is active.
- ******************************************************************************/
- void CQTDoc::UpdateMenus()
- {
- inherited::UpdateMenus();
-
- gBartender->EnableCmd(cmdImportMovieItem);
- }
-
-
-
-
- /******************************************************************************
- OpenQTFile
-
- Opens the movie file into a window
- ******************************************************************************/
- void CQTDoc::OpenQTFile(FSSpec *movieSpec)
- {
- MakeNewWindow();
- ((CQTPane*)itsMainPane)->ImportMovie(movieSpec);
- itsWindow->SetTitle(movieSpec->name);
- itsWindow->Select();
- }
-
-